<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改签到管理')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-signin-edit" th:object="${signIn}">
            <input name="signInId" th:field="*{signInId}" type="hidden">
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">课程：</label>
                <div class="col-sm-8">
                    <select class="form-control m-b" name="courseId" disabled="disabled" required>
                        <option value=""></option>
                        <option th:each="course : ${courses}" th:text="${course.courseName}"
                                th:value="${course.courseId}"
                                th:attr="selected=(${signIn.courseId} == ${course.courseId} ? true: false)">
                        </option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">有效时间(分钟)：</label>
                <div class="col-sm-8">
                    <input name="validTime" th:field="*{validTime}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">校验码：</label>
                <div class="col-sm-8">
                    <input name="verifyCode" th:field="*{verifyCode}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">备注：</label>
                <div class="col-sm-8">
                    <textarea name="remark" class="form-control">[[*{remark}]]</textarea>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">
        var prefix = ctx + "cws/signin";
        $("#form-signin-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-signin-edit').serialize());
            }
        }

        $("input[name='startTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        $("input[name='endTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
    </script>
</body>
</html>